package com.tuanzi.loan.business.service.templateConf.impl;

import com.tuanzi.loan.business.entity.templateConf.LoanApiModelItemOptionbasisEntity;
import com.tuanzi.loan.business.repository.templateConf.TemplateItemOptionRepository;
import com.tuanzi.loan.business.service.templateConf.TemplateItemOptionService;
import com.tuanzi.loan.core.aspect.Debug;
import com.tuanzi.loan.core.service.CommonServiceImpl;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.retry.RetryException;
import org.springframework.retry.annotation.Retryable;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Slf4j
@Debug
@Service
@Transactional
@Retryable(value = { RetryException.class })
public class TemplateItemOptionServiceImpl extends CommonServiceImpl<LoanApiModelItemOptionbasisEntity, Long> implements TemplateItemOptionService {

	@Autowired
	private TemplateItemOptionRepository templateItemOptionRepository;

	@Override
	protected JpaRepository<LoanApiModelItemOptionbasisEntity, Long> getRepository() {
		return templateItemOptionRepository;
	}

	@Override
	public List<LoanApiModelItemOptionbasisEntity> findByItembasisId(Long itembasisId) {
		return templateItemOptionRepository.findByItembasisId(itembasisId);
	}
}
